import java.util.Scanner;

public class Day2 {
    /**
     * 数组中两个字符串的最小距离
     */




    /**
     * 最小花费爬楼梯
     */
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] cost = new int[scanner.nextInt()];
        for (int i = 0; i < cost.length; i++) {
            cost[i] = scanner.nextInt();
        }
        System.out.println(minCostClimbStairs(cost));
    }

    public static int minCostClimbStairs(int[] cost) {
        int len = cost.length;
        int[] dp = new int[len + 1];
        dp[0] = 0;
        dp[1] = 0;
        for (int i = 2; i <= len; i++) {
            dp[i] = Math.min(dp[i-1] + cost[i-1], dp[i-2] + cost[i-2]);
        }
        return dp[len];
    }

    /**
     * 牛牛的快递
     * @param args
     */
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        float a = scanner.nextFloat();
        char b = scanner.next().charAt(0);
        int piece = 0;

        if (a <= 1) {
            piece = 20;
        } else {
            piece = 20 + (int)(a - 0.1);
        }

        if (b == 'y') {
            System.out.println(piece + 5);
        } else {
            System.out.println(piece);
        }
    }
}
